#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>


char jp[9][7] = { " ","abc","def","ghi","jkl","mno","pqrs","tuv","wxyz"};
int main()
{
	char ch;
	int ret = 0;
	while ((ch = getchar()) != '\n') {
		for(int i=0;i<9;i++)
			for (int j = 0; j < 5; j++) {
				if (jp[i][j] == ch)ret += ++j;
			}
	}
	printf("%d", ret);
	return 0;
}